package com.wyp168.leetcode;

/**
 * @ClassName ConvertToTitleSolution
 * @Title TODO
 * @Description TODO
 * @Author wyp168
 * @Date 2022/10/12 22:35
 */
public class ConvertToTitleSolution {
    public static void main(String[] args) {
        ConvertToTitleSolution solution = new ConvertToTitleSolution();
        System.out.println(solution.convertToTitle(24));
    }

    public String convertToTitle(int columnNumber) {
        char[] words = new char[27];

        for (int i = 1; i < words.length; i++) {
            words[i] = (char)(64 + i);
        }

        StringBuffer sb = new StringBuffer();
        if (columnNumber <= 26) {
            sb.append(words[columnNumber]);
            return sb.toString();
        }
        //TODO 2022.10.13 09:07  by wyp168
        return new String();
    }
}
